package com.nuanshui.heatedloan.credit.pay.constant;

import com.nuanshui.heatedloan.credit.pay.PayRequest;
import com.nuanshui.heatedloan.credit.pay.TransRequestCode;

public class PayBizCode {

    private static final Integer CUSTOM_PAY_PREFIX = 70000;

    private static final Integer CUSTOM_REPAY_PREFIX = 80000;

    //19900是实时代笔代收交业务代码
    public static final String REPAY_BIZ_CODE = "19900";
    //09900是实时单笔代付业务代码
    public static final String PAY_BIZ_CODE = "09900";

    public static String getBizCode(PayRequest request) {

        Integer bizCode=null;
        if(request.getTransRequestCode()== TransRequestCode.TRX_CODE_SINGLE_PAY)
        {
            bizCode = CUSTOM_PAY_PREFIX + Integer.parseInt(request.getBizType());
        }
        else if(request.getTransRequestCode()== TransRequestCode.TRX_CODE_REPAY)
        {
            bizCode = CUSTOM_REPAY_PREFIX + Integer.parseInt(request.getBizType());
        }

        return bizCode.toString();
    }
}
